package com.liuzy.openapi;

import com.liuzy.tool.HTTP;

/**
 * 和风天气接口 http://www.heweather.com/
 * 
 * @author liuzy
 * @since 2016年2月23日
 */
public class HeWeatherApi {
	public static String key = "4bc65d444ea5469fbd9d805739799a5b";
	public static HTTP http = new HTTP();

	public static void main(String[] args) {
		getCityId();
		getWeather();
	}

	public static String getWeather() {
		http.put2url("cityid", "CN101021300");
		http.put2url("key", key);
		return http.doGET("https://api.heweather.com/x3/weather");
	}

	public static String getCityId() {
		// 国内城市：allchina、 热门城市：hotworld、 全部城市：allworld
		http.put2url("search", "allworld");
		http.put2url("key", key);
		return http.doGET("https://api.heweather.com/x3/citylist");
	}
}
